package Work.com;

import java.util.Scanner;

public class Exam04 {
    public static void reSort(String str) {
        if (str.length() == 1)
            System.out.println(str);
        else {
            String a = str.substring(0, str.length() - 1);
            String b = str.substring(str.length() - 1);
            System.out.print(b);
            reSort(a);
        }
    }
    private static void reverseString1(String str) {
        char[] chr = str.toCharArray();
        for (int i = chr.length-1 ; i >= 0; i--) {
            System.out.print(chr[i]);
        }
        System.out.println("\t");

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String str = sc.next();
        reverseString1(str);
    }
}
